package whf.framework.report.jasper;

import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.util.Map;

import net.sf.jasperreports.engine.JasperPrint;

/**
 * @author King
 * @create Jan 18, 2008 2:23:52 PM
 */
public class AppletJasperReportExporter extends JasperReportExporter {

	/* (non-Javadoc)
	 * @see whf.framework.report.jasper.JasperReportExporter#exportReport(net.sf.jasperreports.engine.JasperPrint, java.io.OutputStream)
	 */
	@Override
	protected void exportJasperReport(JasperPrint jasperPrint, OutputStream out) throws Exception {
		ObjectOutputStream oos = new ObjectOutputStream(out);
		oos.writeObject(jasperPrint);
		oos.flush();
		oos.close();
	}

	/* (non-Javadoc)
	 * @see whf.framework.report.ReportExporter#getContentType()
	 */
	public String getContentType() {
		return "application/octet-stream";
	}

	/* (non-Javadoc)
	 * @see whf.framework.report.ReportExporter#getHeaders()
	 */
	public Map<String, String> getHeaders() {
		return null;
	}
}
